Skip to content

Fix: Awaiting Response Category - #144

Merged
BenHall-1 merged 1 commit into
masterfrom
fix-awaiting-response-category
Aug 30, 2026
Merged

Fix: Awaiting Response Category#144
BenHall-1 merged 1 commit into
masterfrom
fix-awaiting-response-category

Conversation

@biast12

@biast12 biast12 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Description

Awaiting Response Category has been fully broken since #140.

That release added an in-process category update publisher, but it was written on a branch predating the Kafka→Redis migration and still published to tickets.rpc.categoryupdate. The only listener is on stream:rpc:categoryupdate, so every message went to a stream with no consumer group. ProduceSync XADDs to any name and auto-creates the stream, so this failed silently — no error, no warning, no log.

CategoryUpdateQueue.GetReadyForUpdate is a DELETE ... RETURNING, so reading consumes.
The publisher's 30s eligibility window meant rows were deleted at age 30s and never survived to the 10m window category-update-producer polls with — so that service saw an empty queue on every run. Not a race: deterministically 0%.

Both directions were affected, into the awaiting category and back out.

Changes

  • tickets.rpc.categoryupdatestream:rpc:categoryupdate.
  • Delay 30s → 10m, interval 10s → 1m. Discord allows 2 channel edits per 10 minutes per channel; at 30s a staff→user→staff exchange exhausts that in ~90s, and since the row is already deleted there is no retry. 10m matches the documented behaviour.
  • Split the context timeout off the tick interval. It reused the 10s interval, so a slow publish loop dropped rows that no longer existed in the database.
  • Exported CategoryUpdateStream and registered the listener with it, so publisher and consumer can no longer drift.

Remove the category-update-producer service — the worker now owns the queue, and two pollers on a destructive read steal rows from each other.

Once XLEN tickets.rpc.categoryupdate stops increasing, DEL it. Do not replay: those messages reference deleted rows and stale statuses.

Retiring that service also drops two bugs it had — clearing a panel's awaiting category stranded tickets in it, and a category of 0 produced a no-op PATCH that still consumed a rate-limit token. The worker's categoryForStatus handles both.

Type of Change

  • Bug fix
  • New feature
  • Breaking change

Testing

Awaiting Response Category should work again

Checklist

  • My code follows the style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Awaiting Response Category has been fully broken since #140
@biast12
biast12 requested a review from a team as a code owner August 29, 2026 13:38
@github-actions github-actions Bot added the type:bug Bug Fixes label Aug 29, 2026
@BenHall-1
BenHall-1 merged commit a4717a4 into master Aug 30, 2026
1 check passed
@BenHall-1
BenHall-1 deleted the fix-awaiting-response-category branch August 30, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants